!{include file='common/iheader.htm'}
<style>
	#wiki_img_list{}
	#wiki_img_list li{height:200px;width:154px;}
</style>
<div id="i_nav">
	<h3 class="page_title">WIKI图片编辑 - !{$dict.word}</h3>
	<a class="button" href="/manager.php?app=wiki">WIKI管理</a>
</div>
!{foreach from=$dict.items item=content key=index}
<div class="form_item">
	<h4>!{$index}</h4>
	<hr>
	<ul class="img_list" id="wiki_img_list">
		!{foreach from=$content.images item=img key=img_id}
		<li>
			<img class="lazy" data-original="!{res file=$img.file thumb=150x150}" src="!{res file='images/grey.gif'}" width="150px" height="150px">
			<div class="opts"><a href="javascript:void(0)" onclick="del(this, '!{$index}', '!{$img_id}')">删除</a></div>
		</li>
		!{foreachelse}
		<li>暂无图片</li>
		!{/foreach}
	</ul>
</div>
!{foreachelse}
<div class="form_item">
	暂无目录！
</div>
!{/foreach}

<script src="!{res file='js/jquery_plus/jquery.lazyload.min.js'}"></script>
<script>
	$(function(){
		$('img.lazy').lazyload({
			effect : 'fadeIn',
			threshold : 100, 
			load : function(){
				$(this).removeAttr('height').removeAttr('width').auto_img();
			}
		});
	});
	
	function del(img, index, img_index){
		if(confirm('删除可能其它地方的引用无法显示，是否继续删除？')){
			var url = "/manager.php?app=wiki&act=del_img&&id=!{$dict._id}&index=" + index + "&img_index=" + img_index;
			$.get(url,function(data){
				var json = eval('(' + data + ')');
				alert(json.info);
				if(json.result){
					$(img).parents('li').remove();
				}
			});
			
		}
	}
</script>
!{include file='common/ifooter.htm'}